AC_INIT([rhythmpnp], [0.2.0], [sejerpz@tin.it], [rhythmpnp])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE

AC_PROG_CC
AM_PROG_CC_C_O
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

AC_PATH_PROG(VALAC, valac, valac)
AC_SUBST(VALAC)

AH_TEMPLATE([GETTEXT_PACKAGE], [Package name for gettext])
GETTEXT_PACKAGE=rhythmpnp
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT
IT_PROG_INTLTOOL([0.35.0])

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

AC_ARG_WITH([plugindir], AS_HELP_STRING([--with-plugindir=PATH],[use PATH as base plugin directory]), [
                PLUGINDIR=$withval
        ],[
                #standard rhythmbox plugin directory
                PLUGINDIR=$prefix/lib/rhythmbox/plugins
        ])

AC_DEFINE_UNQUOTED([PLUGINDIR], ["$PLUGINDIR"], [Rhythmbox plugin directory])
AC_SUBST(PLUGINDIR)

GLIB_REQUIRED=2.12.0
GTK_REQUIRED=2.18.0
GUPNP_REQUIRED=0.13.2
GUPNP_AV_REQUIRED=0.5.2
LIBSOUP_REQUIRED=2.30.0

PKG_CHECK_MODULES(RHYTHMPNP, [glib-2.0 >= $GLIB_REQUIRED 
			gobject-2.0 >= $GLIB_REQUIRED 
			gupnp-1.0 >= $GUPNP_REQUIRED 
			gupnp-av-1.0 >= $GUPNP_AV_REQUIRED
			gtk+-2.0 >= $GTK_REQUIRED
			libsoup-2.4 >= $LIBSOUP_REQUIRED])

AC_SUBST(RHYTHMPNP_CFLAGS)
AC_SUBST(RHYTHMPNP_LIBS)

AC_CONFIG_FILES([Makefile
	src/Makefile
	vapi/Makefile
	rb-include/Makefile
	po/Makefile.in])

AC_OUTPUT
